IF EXISTS (SELECT * FROM sysobjects WHERE type = 'V' AND name = 'vwProviderOtherData')
	BEGIN
		DROP  View vwProviderOtherData
	END
GO

CREATE View vwProviderOtherData AS

	select p.ProviderPk,
		p.ProviderName,
		p.ProviderIsEditor,
		od.*
	from tblProviderOtherData od
	inner join tblProviderImport pim on pim.ProviderImportPk = od.POtherDataProviderImportFk
	inner join tblProvider p on p.ProviderPk = pim.ProviderImportProviderFk

GO


GRANT SELECT ON vwProviderOtherData TO PUBLIC

GO

